﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace EPMAuditing.EventHandlers.RegisterEvents
{
    public partial class CredentialsForm : Form
    {
        public CredentialsForm()
        {
            InitializeComponent();
        }

        private void checkBoxWindowsAuth_CheckedChanged(object sender, EventArgs e)
        {
            if (checkBoxWindowsAuth.Checked == true)
            {
                textBoxDomain.Enabled = true;
                label2.Enabled = true;
            }
            else
            {
                textBoxDomain.Enabled = false;
                label2.Enabled = false;
            }

        }

        public string UserName
        {
            get { return textBoxUserName.Text; }
        }

        public string Domain
        {
            get 
            {
                if (checkBoxWindowsAuth.Checked == true)
                    return textBoxDomain.Text;
                else
                    return string.Empty;
            }
        }

        public string Password
        {
            get { return textBoxPassword.Text; }
        }

        public bool IsWindowsAuth
        {
            get { return checkBoxWindowsAuth.Checked; }
        }
    }
}